Skip to content

Alpha version reactions 5#6

Open
overkam wants to merge 10 commits intomasterfrom
alpha-version-reactions
Open

Alpha version reactions 5#6
overkam wants to merge 10 commits intomasterfrom
alpha-version-reactions

Conversation

@overkam
Copy link
Copy Markdown
Owner

@overkam overkam commented Nov 25, 2018

No description provided.

reactions.js Outdated
* @returns {HTMLElement} div
*/
make(tagName, className) {
let div = document.createElement(tagName);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

почему переменная называется div если функция принимает любой тег?

reactions.js Outdated
* @returns {HTMLElement} div
*/
* Create blocks and give CSS class
* @param {CSSClass} CSSClass - CSS class for block
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нет такого типа (CSSClass)

reactions.js Outdated
counter
);

}else{
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

} eles {

reactions.js Outdated
this.nodes.countBlock[i].innerHTML = ++this.count;

this.removeReaction(
itemActive,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

код надо оформить нормально

reactions.js Outdated

/**
* If we have an active count block write decreased counter
* @type {string}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@type тут не нужен

reactions.js Outdated
*/
make(tagName, className) {
let div = document.createElement(tagName);
let element = document.createElement(tagName);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const

reactions.js Outdated
this.nodes.unicode = settings.emojiCodes;
this.titleText = settings.title;
this.appendElementsToWrapper();
this.count=0;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.count=0;
this.count = 0;

/**
* Append emoji and counter to emojiBlock
*/
appendElementsToEmojiBlock(){
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно весь код прогнать через линтер

reactions.js Outdated
* Add emoji to button
* @type {string}
*/
this.nodes.button[i].innerText = String.fromCodePoint(this.nodes.unicode[i]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше использовать textContent
http://kellegous.com/j/2013/02/27/innertext-vs-textcontent/

reactions.js Outdated
* Find an active button
* @type {HTMLElement}
*/
let itemActive = document.querySelector('.reactions__button--active');
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше сохранять это внутри класса, а не искать каждый раз в DOM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants